package SalaryManagementSystem;

public class Saler extends Employee{
    private double deductRate;//销售提成比例
    private int personSaleAmount;//个人销售额
    private static int money=0;//记录个人销售额,方便销售经理的计算
    public Saler(){
    }
    public Saler(int num, String name, String sex, int age, String professionalTitle, String educationBackground, String department, boolean isPartymember, double deductRate, int personSaleAmount) {//	在定义Saler类的构造函数，使用supper关键字
        super(num, name, sex, age, professionalTitle, educationBackground, department, isPartymember);
        super.setJobwage(200);//	该类员工的岗位工资固定为200。
        this.deductRate = deductRate;
        this.personSaleAmount = personSaleAmount;
        money+=personSaleAmount;//每次创建Saler对象销售额就会累积，得出总数
    }
    @Override
    public int realWage(){//	该类员工实发工资的计算方法为：实发工资=基本工资+岗位工资+个人销售额*提成比例。
        return (getBasicsalary()+getJobwage()+(int)(personSaleAmount*deductRate));
    }
   @Override
   public void showSalary(){//	覆盖成员方法ShowSalary（输出工资条信息），内容包括：编号、姓名、职称、基本工资、岗位工资、提成比例、个人销售额、实发工资。
       System.out.println("num:"+getNum()+"name:"+getName()+"职称:"+getProfessionalTitle()+"基本工资:"+getBasicsalary()+"岗位工资:"+getJobwage()+"提成比例"+deductRate+ "个人销售额"+personSaleAmount+"实发工资"+realWage());
 }

    public double getDeductRate() {
        return deductRate;
    }

    public void setDeductRate(double deductRate) {
        this.deductRate = deductRate;
    }

    public int getPersonSaleAmount() {
        return personSaleAmount;
    }

    public void setPersonSaleAmount(int personSaleAmount) {
        this.personSaleAmount = personSaleAmount;
    }

    public static int getMoney() {
        return money;
    }

    public static void setMoney(int money) {
        Saler.money = money;
    }

    public static void main(String[] args) {

    }
}
